//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package imagetoolscommon;

import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Point;
import java.awt.SystemColor;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.Border;

public class AboutBox extends JDialog {
    protected ImageIcon image1;
    protected String title = "Application Title";
    protected String version = "Version Number";
    protected String copyright = "Copyright text";
    protected String comments = "Description of the application.";
    private JLabel copyrightLabel;
    private JButton jButton1;
    private JLabel jLabel1;
    private JPanel jPanel1;
    private JPanel jPanel2;
    private JPanel jPanel3;
    private JScrollPane jScrollPane1;
    private JTextArea jTextArea1;
    private JLabel titleLabel;
    private JLabel versionLabel;

    public AboutBox(Frame parent, boolean modal) {
        super(parent, modal);
    }

    public AboutBox(Frame parent, boolean modal, ImageIcon image, String title, String version, String copyright, String comments) {
        super(parent, modal);
        this.image1 = image;
        this.title = title;
        this.version = version;
        this.copyright = copyright;
        this.comments = comments;
        this.initComponents();
        this.jTextArea1.setCaretPosition(0);
        Dimension dlgSize = this.getSize();
        Dimension frmSize = Toolkit.getDefaultToolkit().getScreenSize();
        Point loc = this.getLocation();
        this.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    }

    private void initComponents() {
        this.jPanel1 = new JPanel();
        this.jLabel1 = new JLabel();
        this.jPanel2 = new JPanel();
        this.titleLabel = new JLabel();
        this.versionLabel = new JLabel();
        this.copyrightLabel = new JLabel();
        this.jScrollPane1 = new JScrollPane();
        this.jTextArea1 = new JTextArea();
        this.jPanel3 = new JPanel();
        this.jButton1 = new JButton();
        this.setDefaultCloseOperation(2);
        this.setTitle("About");
        this.jLabel1.setIcon(this.image1);
        this.jLabel1.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        this.jPanel1.add(this.jLabel1);
        this.getContentPane().add(this.jPanel1, "West");
        this.jPanel2.setLayout(new GridBagLayout());
        this.titleLabel.setFont(new Font("Tahoma", 1, 14));
        this.titleLabel.setText(this.title);
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = 17;
        gridBagConstraints.insets = new Insets(0, 0, 0, 16);
        this.jPanel2.add(this.titleLabel, gridBagConstraints);
        this.versionLabel.setFont(new Font("Tahoma", 0, 12));
        this.versionLabel.setText(this.version);
        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = 17;
        gridBagConstraints.insets = new Insets(0, 0, 0, 16);
        this.jPanel2.add(this.versionLabel, gridBagConstraints);
        this.copyrightLabel.setFont(new Font("Tahoma", 0, 12));
        this.copyrightLabel.setText(this.copyright);
        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = 17;
        gridBagConstraints.insets = new Insets(0, 0, 12, 16);
        this.jPanel2.add(this.copyrightLabel, gridBagConstraints);
        this.jScrollPane1.setBorder((Border)null);
        this.jScrollPane1.setHorizontalScrollBarPolicy(31);
        this.jScrollPane1.setAutoscrolls(true);
        this.jTextArea1.setBackground(SystemColor.control);
        this.jTextArea1.setColumns(20);
        this.jTextArea1.setEditable(false);
        this.jTextArea1.setFont(new Font("Tahoma", 0, 12));
        this.jTextArea1.setLineWrap(true);
        this.jTextArea1.setRows(12);
        this.jTextArea1.setText(this.comments);
        this.jTextArea1.setWrapStyleWord(true);
        this.jTextArea1.setBorder((Border)null);
        this.jScrollPane1.setViewportView(this.jTextArea1);
        gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = 1;
        gridBagConstraints.weightx = 1.0D;
        gridBagConstraints.weighty = 0.9D;
        gridBagConstraints.insets = new Insets(0, 0, 0, 16);
        this.jPanel2.add(this.jScrollPane1, gridBagConstraints);
        this.getContentPane().add(this.jPanel2, "Center");
        this.jButton1.setText("OK");
        this.jButton1.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                AboutBox.this.jButton1ActionPerformed(evt);
            }
        });
        this.jPanel3.add(this.jButton1);
        this.getContentPane().add(this.jPanel3, "South");
        this.pack();
    }

    private void jButton1ActionPerformed(ActionEvent evt) {
        this.dispose();
    }

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                (new AboutBox(new JFrame(), true)).setVisible(true);
            }
        });
    }
}
